/*
 Errors.h
 MailDelivery
 
 Created by Dante Palacios on 05/09/09.
 Copyright 2009 Dante Palacios. All rights reserved.
 */

/*!
 @header Errors.h
 @discussion This header contains NSError codes in <code>MailDeliveryErrorDomain</code>. For more information, contact palacios.dante\@gmail.com.
 */

#import <Foundation/Foundation.h>

// NSError domain

/*!
 @const MailDeliveryErrorDomain
 @discussion NSError domain for the framework.
 */

extern NSString *MailDeliveryErrorDomain;

/*!
 @enum MailDeliveryErrors
 @abstract NSError codes in <code>MailDeliveryErrorDomain</code>.
 @discussion Constants that represent some posible errors at the time to send an email.
 @constant kMailDeliveryMiscellaneousError Everything else not enumerated.
 @constant kMailDeliveryWrongArgumentsError Message without sender or something like that.
 @constant kMailDeliveryEHLOMessageError SMTP server refused our EHLO message.
 @constant kMailDeliveryConnectionError Error while trying to make the connection.
 @constant kMailDeliveryConnectionTimeoutError Timeout while connecting. Default timeout 60 segs.
 @constant kMailDeliveryUnsupportedLoginError Framework does not support the authentication mechanism specified by SMTP server.
 @constant kMailDeliveryAuthenticationError Authentication failed, bad username or password.
 @constant kMailDeliveryMessageDataExceedsLimitError Message data exceeds limit specified by the server.
 @constant kMailDeliverySenderRefusedError SMTP server refused \@"From" address.
 @constant kMailDeliveryRecipientsRefusedError All recipient addresses refused by SMTP server.
 @constant kMailDeliveryDataError SMTP server refused to accept the message data.
 @constant kSSLConnectionsFailedError SSL connection failed.
 @constant kSSLCertificateDoesNotVerifyError SSL certificate doesn't verify.
 @constant kSSLCertificateDoesNotMatchHostNameError SSL certificate common name doesn't match host name.
 */

enum {
	kMailDeliveryMiscellaneousError = 12,
	kMailDeliveryWrongArgumentsError = 11,
	kMailDeliveryEHLOMessageError = 4,
	kMailDeliveryConnectionError = 5,
	kMailDeliveryConnectionTimeoutError = 7,
	kMailDeliveryUnsupportedLoginError = 10,
	kMailDeliveryAuthenticationError = 535,
	kMailDeliveryMessageDataExceedsLimitError = 9,
	kMailDeliverySenderRefusedError = 8,
	kMailDeliveryRecipientsRefusedError = 6,
	kMailDeliveryDataError = 354,
	kSSLConnectionsFailedError = 1, 
	kSSLCertificateDoesNotVerifyError = 2,
	kSSLCertificateDoesNotMatchHostNameError = 3
};
